package com.group.order.controller;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.group.commons.annotation.BaseResponse;
import com.group.order.entity.Registration;
import com.group.order.entity.vo.RegistrationDetailVo;
import com.group.order.entity.vo.RegistrationListVo;
import com.group.order.service.RegistrationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/registration")
@Api(tags = "订单系统相关接口")
@Slf4j
@BaseResponse
public class RegistrationController {
    @Resource
    RegistrationService registrationService;
    @GetMapping("/test")
    @ApiOperation(value = "用户登录", notes = "用户登录")
    public List<RegistrationListVo> list() {
        Page<RegistrationListVo> test = new Page<>(1,3);
        List<RegistrationListVo> page = registrationService.getPage(test);
        log.info("page = {}",page);
        return page;
    }

    @GetMapping("/detail/{id}")
    public RegistrationDetailVo get(@PathVariable("id") int id){
        return registrationService.getRegistrationDetail(id);
    }


}
